<script setup>
import ShopInfo from '@/components/ShopInfo.vue'
import { useShopInfoStore, useCartStore } from '@/stores'

import { computed } from 'vue'

const shopInfo = useShopInfoStore()
const cartStore = useCartStore()
console.log(cartStore.cartList)

console.log(shopInfo.nearbyList)

// axios get nearbyList
// axios.get().then(res => { shopInfo = res })
const nearbyList = computed(() => shopInfo.nearbyList)

// onMounted  axios
</script>

<template>
  <!-- 附近店铺 -->
  <div class="nearby">
    <h3 class="nearby_title">附近店铺</h3>
    <ShopInfo :item="item" v-for="item in nearbyList" :key="item.name" />
  </div>
</template>

<style lang="scss" scoped>
@import '@/style/viriables.scss';
.nearby {
  &_title {
    margin: 0.16rem 0;
    font-size: 0.18rem;
    font-family: PingFangSC-Medium;
    font-weight: normal;
    line-height: 0.25rem;
    color: $content_fontcolor;
    margin-left: 15px;
  }
  a {
    text-decoration: none;
  }
}
</style>